package com.zhuiyun.project.api.vipPlan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhuiyun.project.api.coachmanagement.model.MemberPlanActionModel;
import com.zhuiyun.project.api.plan.fitnessAction.entity.FitnessAction;
import com.zhuiyun.project.api.plan.fitnessPlan.entity.FitnessPlan;
import com.zhuiyun.project.api.plan.fitnessPlanAction.entity.FitnessPlanAction;
import com.zhuiyun.project.api.plan.fitnessPlanActionCount.entity.FitnessPlanActionCount;
import com.zhuiyun.project.api.plan.fitnessSeries.entity.FitnessSeries;
import com.zhuiyun.project.api.plan.fitnessType.entity.FitnessType;
import com.zhuiyun.project.api.reservation.entity.Reservation;
import com.zhuiyun.project.api.reservation.entity.TrainingTime;
import com.zhuiyun.project.api.userrecord.entity.UserRecord;
import com.zhuiyun.project.api.vipPlan.entity.ActionCount;
import com.zhuiyun.project.api.vipPlan.entity.MemberPlan;

import com.zhuiyun.project.api.vipPlan.model.ActionListModel;
import com.zhuiyun.project.api.vipPlan.model.AddImageCaseModel;
import com.zhuiyun.project.api.vipPlan.model.CountModel;
import com.zhuiyun.project.api.vipPlan.model.ReservationTimeModel;
import lombok.Data;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;

/**
 * @ClassName VipPlanMapper
 * @Description TODO 会员课程持久层
 * @Author 杨友朋
 * @Date 2023/12/4 15:38
 **/
@Mapper
public interface VipPlanMapper extends BaseMapper<MemberPlan> {

    /**
    * @Author 杨友朋
    * @Description 查询系列中的课程
    * @Date 2023/12/6 9:56
    * @Return List<FitnessPlan>
    * @param seriesId
    */
    List<FitnessPlan> selectPlan(int seriesId);

    /**
    * @Author 杨友朋
    * @Description 绑定用户的训练课程
    * @Date 2023/12/6 9:57
    * @Return int
    * @param memberPlan
    */
    int insertPlan(MemberPlan memberPlan);

    /**
    * @Author 杨友朋
    * @Description 查询课程的动作
    * @Date 2023/12/6 9:58
    * @Return List<FitnessPlanAction>
    * @param planId
    */
    List<FitnessPlanAction> selectAction(int planId);

    /**
    * @Author 杨友朋
    * @Description 查询动作的次数
    * @Date 2023/12/6 9:58
    * @Return FitnessPlanActionCount
    * @param fitnessActionId
    */
    List<FitnessPlanActionCount> selectActionCount(int fitnessActionId);

    /**
    * @Author 杨友朋
    * @Description 查询用户分配的课程
    * @Date 2023/12/6 9:59
    * @Return List<ActionListModel>
    * @param memberId
    */
    List<ActionListModel> memberSelectPlan(int memberId);

    List<ActionListModel> memberSelectReservation(int memberId, String isComplete, String coachCode);

    ActionListModel selectReservationById(int courseId);

    /**
    * @Author 杨友朋
    * @Description 查询所有系列
    * @Date 2023/12/6 10:00
    * @Return List<FitnessSeries>
    * @param coachId
    */
    List<FitnessSeries> selectSeries(int coachId,String venueUniqueIdentifier);

    /**
    * @Author 杨友朋
    * @Description 查询教练一天的训练预约
    * @Date 2023/12/6 10:00
    * @Return List<ReservationTimeModel>
    * @param coachId,reservationTime
    */
    List<ReservationTimeModel> selectReservationTime(int coachId,String reservationTime);

    /**
    * @Author 杨友朋
    * @Description 预约课程
    * @Date 2023/12/6 15:18
    * @Return int
    * @param reservation
    */
    int reservationPlan(Reservation reservation);

    /**
    * @Author 杨友朋
    * @Description 查询所有教练的训练课程
    * @Date 2023/12/7 8:42
    * @Return List<ActionListModel>
    * @param invitationCode,selectYear
    */
    List<ActionListModel> selectAllPlan(String invitationCode, String selectYear, String isComplete, String selectMonth, String daiXunLianDate);

    List<MemberPlanActionModel> selectActionByPlan(int planId);

    List<ActionCount> selectActionCountByActionId(int id);

    int removeActionCount(int actionId);

    int removeAction(int actionId);

    List<FitnessType> getFitnessType(int fitnessPurposeId);

    List<FitnessAction> getAllAction(int fitnessTypeId);

    int cancelReservation(int courseId, int studentId);

    int completePlan(MemberPlan memberPlan);
    /*
    * @Author wuwan
    * @Description 上传训练的图片
    * @Date 2023/12/12 10:18
    * @Return
    */
    Integer saveImageToDatabase(AddImageCaseModel addImageCaseModel);
    /*
    * @Author wuwan
    * @Description 删除案例图片
    * @Date 2023/12/20 15:54
    * @Return
    */
    Integer DeleteImageToDatabase(AddImageCaseModel addImageCaseModel);
    /*
    * @Author wuwan
    * @Description 完成训练
    * @Date 2023/12/20 15:52
    * @Return
    */
    Integer completeReservation(MemberPlan memberPlan);
    /*
    * @Author wuwan
    * @Description 完成训练
    * @Date 2023/12/20 15:52
    * @Return
    */
    Integer upNumber(UserRecord userRecord);
    /*
    * @Author wuwan
    * @Description 上传训练
    * @Date 2023/12/20 15:52
    * @Return
    */
    Integer upCompleteReservation(MemberPlan memberPlan);

    Integer updateIsAllocation(Integer userId);
    /*
     * @Author wuwan
     * @Description 上传学员课程记录
     * @Date 2023/11/20 15:08
     * @Return
     */
    Integer addUserRecord(UserRecord userRecord);
    /*
    * @Author wuwan
    * @Description 查询教练每日的所有课程
    * @Date 2023/12/21 19:42
    * @Return
    */
    CountModel getCount(String daiXunLianDate,String invitationCode);
    /*
    * @Author wuwan
    * @Description 统计教练的时间总数
    * @Date 2023/12/21 19:42
    * @Return
    */
    CountModel getTime(Integer coachId);
}
